---
title: Copy a task to another user
summary: Duplicate a task's core fields onto a new instance, including deep-copied context values.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-08-21
library: SAIF.Business.Tasks
reference_type: embedded
operation_id: OP-10
trigger: Descendant CopyTo(inMailID) implementation calls the shared CopyTask helper
---

# Copy a task to another user

This operation copies a task's core fields onto a new task instance — used when reassigning or forwarding a task to a different user.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-10 |
| **Trigger** | Descendant `CopyTo(inMailID)` |
| **Inputs** | Source `clsTask` |
| **Outputs** | New `iTask` with copied fields and duplicated context |
| **Primary components** | `clsTask.CopyTask` |
| **Entry point** | `SAIF.Business.Tasks/clsTask.vb` |

## Steps

1. Copy `CategoryCode`, `PriorityCode`, `NotepadFlag`, `TaskDate`, `MailID`, `Text` onto the target instance.
2. For `ClaimID`, `ImageSeqNum`, `PolicyNumber`: propagate null via the corresponding `Set*Null()` method when the source smart value is empty; otherwise copy the value.
3. Assign `inTask.TaskContext = TaskContext.Duplicate()` — a deep copy that preserves empty/null state.
4. The public `CopyTo(inMailID)` method itself is abstract; descendants create the new instance and call `CopyTask` to populate it.*

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Descendant CopyTo called]) --> S1["Descendant creates new task<br>instance"]
	S1 --> S2[CopyTask copies core fields]
	S2 --> S3{"ClaimID/ImageSeqNum/PolicyNumber<br>empty?"}
	S3 -->|Yes| S4[Propagate null via Set*Null]
	S3 -->|No| S5[Copy value]
	S4 --> S6["TaskContext.Duplicate deep<br>copy"]
	S5 --> S6
	S6 --> EndOk([New task instance returned])
```

## Failure and edge-case behavior

- No error handling logic is present in `CopyTask` itself; behavior depends entirely on the descendant's `CopyTo` implementation*.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- SAIF.Business.Tasks/clsTask.vb
